package org.aplikator.client.widgets;

import org.aplikator.client.panels.HorizontalFlowPanel;

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;

public abstract class ContainerFieldBase extends Composite {

    public interface ContainerFieldResources extends ClientBundle {
        public static final ContainerFieldResources INSTANCE = GWT.create(ContainerFieldResources.class);

        @Source("ContainerField.css")
        public ContainerFieldCss css();
    }

    public interface ContainerFieldCss extends CssResource {
        public String contentsHeader();

        public String contentsFrame();

        public String contentsHolder();
    }

    static {
        ContainerFieldResources.INSTANCE.css().ensureInjected();
    }

    protected Panel dataPanel;

    protected HorizontalFlowPanel navigationPanel;

    protected FlowPanel basePanel;

    protected ContainerFieldBase() {
        super();
        HorizontalPanel wrapper = new HorizontalPanel();
        wrapper.setStyleName("WRAPPER");
        initWidget(wrapper);
        basePanel = new FlowPanel();
        // basePanel.setSize("100%", "100%");
        // initWidget(basePanel);
        wrapper.add(basePanel);
        Label strut = new Label();
        wrapper.add(strut);
        wrapper.setCellWidth(strut, "100%");
        // Top navigation panel
        navigationPanel = new HorizontalFlowPanel();
        navigationPanel.setWidth("100%");
        // navigationPanel.setHeight("2em");
        basePanel.add(navigationPanel);

    }

}
